Skip to content

Conversation

@j-t-1
Copy link
Contributor

@j-t-1 j-t-1 commented Mar 21, 2025

RET503: Missing explicit "return" at the end of function able to return non-"None" value.

j-t-1 added 4 commits March 21, 2025 12:18
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
@codecov
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.08%. Comparing base (248e741) to head (525971b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3209      +/-   ##
==========================================
- Coverage   97.09%   97.08%   -0.01%     
==========================================
  Files          56       56              
  Lines        9681     9687       +6     
  Branches     1753     1754       +1     
==========================================
+ Hits         9400     9405       +5     
- Misses        168      169       +1     
  Partials      113      113              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

j-t-1 added 5 commits March 22, 2025 15:11
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
@stefan6419846 stefan6419846 added the needs-test A test should be added before this PR is merged. label Mar 24, 2025
@j-t-1
Copy link
Contributor Author

j-t-1 commented Jul 18, 2025

@stefan6419846 could you fix the two Ruff errors (2 fixable with the --fix option)? I do not have Ruff installed.

@stefan6419846
Copy link
Collaborator

could you fix the two Ruff errors

Just use return None instead of return in these cases if it is a correct detection (as indicated in the help for the violation). If the detection is wrong, we would have to check manually anyway.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Oct 29, 2025

@stefan6419846 the return None is needed so we can remove RET503. Can you think of a way to reach this line, as otherwise code coverage is reduced.

@stefan6419846
Copy link
Collaborator

I guess root = DictionaryObject({NameObject('/Next'): None}) could work, but AFAIK this branch should not be reachable with real PDF files as None is no PDF object. See #3209 (comment) as well.

@j-t-1
Copy link
Contributor Author

j-t-1 commented Oct 29, 2025

I have marked it as pragma: no cover, as agree with you, I think is unreachable with real PDFs. Outlines are conceptually not difficult, and maybe a refactor of them may be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-test A test should be added before this PR is merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants